using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Messages.Entity
{
	[Table("TextFilter", "", "Wicresoft.Messages.ConnectionString")]
	public class TextFilter : Info
	{
		#region SQL column name consts 
		public const string SQLCOL_TEXTFILTERID = "TextFilterID";
		public const string SQLCOL_FILTERWORD = "FilterWord";
		#endregion


		#region Contructors
		/// <summary>
		/// Construct empty entity
		/// </summary>
		public TextFilter () {}

		/// <summary>
		/// Construct entity by primary key, other fields will be assigned by 
		/// "Load" method.
		/// </summary>
		public TextFilter (Guid TextFilterID)
		{
			this.TextFilterID = TextFilterID;
		}
		#endregion

		public override void Init (DataRow row)
		{
			TextFilterID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_TEXTFILTERID]);
			FilterWord = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_FILTERWORD]);
		}

		#region Properties 
		#region Property <Guid> TextFilterID
		[Property("TextFilterID", 16, SqlDbType.UniqueIdentifier, false, true)]
		public Guid TextFilterID 
		{
			get { return _TextFilterID; }
			set { _TextFilterID = value; }
		}
		private Guid _TextFilterID = Guid.Empty;
		#endregion

		#region Property <string> FilterWord
		[Property("FilterWord", 2147483646, SqlDbType.NText, false, false)]
		public string FilterWord 
		{
			get { return _FilterWord; }
			set { _FilterWord = value; }
		}
		private string _FilterWord = null;
		#endregion
		#endregion




	}
}
